3rdstagefandomcom-20200214-history
On Scala
__TOC__ Frameworks MVC Play * https://www.playframework.com/ * Desc. : The High Velocity Web Framework For Java and Scala * License Networking Finagle * http://twitter.github.io/finagle/ * Desc. : an extensible RPC system for the JVM, used to construct high-concurrency servers. * License : * Written in : Scala * Sources : https://github.com/twitter/finagle * Readings ** Finagle User's guide ** Finagle Scala API Distributed * Akka vs Storm (25 June, 2013) Akka * http://akka.io/ * Desc. : a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM. * License : Apache 2 License * Written in : * Sources : https://github.com/akka/akka * References ** Akka 2.4.4 *** Java Documentation **** Akka HTTP *** Java API **** akka.routing.RouterActor class *** Scala 2.11.7 API ** Akka 2.3.15 *** Java Documentation **** Routing **** Cluster Client *** Java API **** akka.actor.ActorSystem class ***** void registerOnTermination(java.lang.Runnable code) method **** akka.cluster.Cluster class **** akka.routing.RouterConfig class **** akka.japi.Util class *** Akka Actor reference config file *** Akka Cluster reference config file ** Typesafe Config Library API *** static com.typesafe.config.ConfigFactory.load() method *** static com.typesafe.config.ConfigFactory.defaultApplication method **** application.conf, application.json, application.properties, config.file, config.resource, and config.url * Books ** [https://www.safaribooksonline.com/library/view/applied-akka-patterns/9781491934876/ Applied Akka Patterns, 2016, Wade Waldron, Michael Nash] * Readings ** Actor model (Wikipedia) ** Understanding actor concurrency (Feb 24, 2009) *** key principles of actor model **** No shared state **** Lightweight processes **** Asynchronous message-passing **** Mailboxes to buffer incoming messages **** Mailbox processing with pattern matching ** Actor Path *** An actor path consists of an anchor, which identifies the actor system, followed by the concatenation of the path elements, from root guardian to the designated actor; the path elements are the names of the traversed actors and are separated by slashes. *** ** Getting Started Tutorial (Java): First Chapter (for Akka 2.0.2) ** Building a scalable and highly available reactive applications with Akka! Load balancing revisited(July 15, 2014) ** Why We Picked AKKA Cluster as our Microservice Framework ** [http://letitcrash.com/post/30585282971/discovering-message-flows-in-actor-systems-with Discovering message flows in actor systems with the Spider Pattern] ** Blocking Needs Careful Management *** The non-exhaustive list of adequate solutions to the “blocking problem” includes the following suggestions: **** Do the blocking call within an actor (or a set of actors managed by a router Scala), making sure to configure a thread pool which is either dedicated for this purpose or sufficiently sized. **** Do the blocking call within a Future, ensuring an upper bound on the number of such calls at any point in time (submitting an unbounded number of tasks of this nature will exhaust your memory or thread limits). **** Do the blocking call within a Future, providing a thread pool with an upper limit on the number of threads which is appropriate for the hardware on which the application runs. **** Dedicate a single thread to manage a set of blocking resources (e.g. a NIO selector driving multiple channels) and dispatch events as they occur as actor messages. ** Akka Cluster Samples with Java ** Akka Camel Samples with Java (April 14, 2016) ** Akka Java Spring ** Akka cluster: how to disable ClusterHeartbeat log (Apr 28 '15) ** Akka Utils: get a single ActorRef for a path ** Routing *** AkkaRouterExample *** Core concepts for routing **** akka.routing.Router : default and only router implementation, not inheritable and immutable **** akka.routing.RouterConfig : router factory **** akka.routing.RoutingLogic : routing logic, should be thread-safe **** akka.routing.Routee : destination for messages routed via a router *** built-in Akka routers and alias akka.actor.router.type-mapping { from-code = "akka.routing.NoRouter" round-robin-pool = "akka.routing.RoundRobinPool" round-robin-group = "akka.routing.RoundRobinGroup" random-pool = "akka.routing.RandomPool" random-group = "akka.routing.RandomGroup" balancing-pool = "akka.routing.BalancingPool" smallest-mailbox-pool = "akka.routing.SmallestMailboxPool" broadcast-pool = "akka.routing.BroadcastPool" broadcast-group = "akka.routing.BroadcastGroup" scatter-gather-pool = "akka.routing.ScatterGatherFirstCompletedPool" scatter-gather-group = "akka.routing.ScatterGatherFirstCompletedGroup" tail-chopping-pool = "akka.routing.TailChoppingPool" tail-chopping-group = "akka.routing.TailChoppingGroup" consistent-hashing-pool = "akka.routing.ConsistentHashingPool" consistent-hashing-group = "akka.routing.ConsistentHashingGroup" } ** Spring *** Typesafe Activator template for Akka and Spring in Java Spark * https://spark.apache.org/ * Desc. : a fast and general engine for large-scale data processing. * License : * Written in : Scala * References ** Official documentation *** Spark 2.0.0 Documentation *** Spark 1.6.2 Documentation **** Spark Configuration Properties *** Spark 1.2.0 Documentation ** Scala API *** Spark 2.0.0 Scala API *** Spark 1.6.2 Scala API ** Java API *** Spark 1.6.2 Java API *** Spark 1.2.0 Java API * Books ** [https://www.gitbook.com/book/jaceklaskowski/mastering-apache-spark/details Mastering Apache Spark] * Readings ** Apache Storm vs. Apache Spark(2014/09) ** Intro to Apache Spark ** Start/Deploy Apache Spark application programmatically using spark launcher ** Spark Streaming *** Spark Streaming Example – How to Stream from Slack ** Spark on Windows *** Running Spark on Windows *** winutils **** Windows binaries for Hadoop versions Testing ScalaTest * http://www.scalatest.org/ * Desc. : the most flexible and most popular testing tool in the Scala ecosystem * License : * Maven artifacts : org.scalatest * Readings ** ScalaTest 2.2.6 API *** org.scalatest.FunSuite class Libraries Tools sbt * http://www.scala-sbt.org/ * Desc. : interactive build tool * License : * Readings ** sbt 0.13 Reference Manual ** sbt 0.13 API Scala.js * http://www.scala-js.org/ * Desc. : the Scala to JavaScript compiler * License : Scala License * Sources : https://github.com/scala-js/scala-js